class Solution {
public:
    int removeDuplicates(vector<int>& nums) {
       size_t size = nums.size();
       for(size_t i = 0; i < size; i++){
           for(size_t j = i + 1; j < size; j++){
               if(nums[i] == nums[j]){
                   size--;
                   //删除后原来的j下标指向下一元素，再++就会跳过一个元素，所以j--
                   j--;
                   nums.erase(nums.begin() + i);
               }
           } 
       }     
        return size;
    }

};